
<div class='fui-page fui-page-current'>
    <div class="fui-header">
		<div class="fui-header-left">
			<a class="back" ng-click="goback()"></a>
		</div>
		<div class="title">缴纳保证金</div> 
		<div class="fui-header-right">&nbsp;</div>
    </div>
    <div class="fui-content">
		<div class='fui-cell-group'>
			<div class='fui-according'>
				<div class='fui-according-header' style="color: #666;line-height:1.2rem;padding-left:0.6rem">
					保证金
					<div class="text" style="font-size:0.65rem;color:#666;line-height:1.2rem;padding-left:1rem">
						需缴纳 <span class='text-danger'>{{pagedata.item.yajinfee}}</span> 元，才可 <span class='text-danger'>开小店！</span>
					</div>
				</div>
			</div>
		</div>
		<div class='fui-cell-group'>
			<div class='fui-cell'>
				<div class='fui-cell-label'>缴纳余额</div>
				<div class='fui-cell-info c000'>￥{{pagedata.item.yajinfee}}</div>
			</div>
		</div>
		<a ng-if="!pagedata.order_id" href="javascript:;" class='btn btn-success block' ng-click="pagedata.recharge()">确认缴纳</a>
		<a ng-if="pagedata.order_id" href="javascript:;" class='btn btn-success block' ng-click="access_json('jy_chengedu/manage.yajin_log/')">查看订单</a>
</div>
<script>
scope.pagedata.recharge=function(){
	scope.post_json('post',scope.pagedata.item,function(res){
		console.log('pay_id');console.log(res);
		scope.pagedata.order_id=res.order_id
		scope.$evalAsync();
		require(['tool'],function(tool){
			tool.pay(res.pay_id,function(res){
				console.log('收到支付结果！');
				if(res.type=='success'){
					scope.message('缴纳成功！','','goback');
				}else{
					scope.message('缴纳失败！'+res.message,'','goback');
				}
			});
		});
	});
}
</script>